home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / PowerFantasm™ 4.19a / PowerFantasm™ / F4_EXAMPLES / PPC_Graphics_demo / graph_demo_init.s next >
Text File  |  1996-08-29  |  1KB  |  50 lines

  1. *******************************
  2. **Fantasm V4 PowerPC demo #1
  3. **Opens two windows and runs various graphical tests
  4. **
  5. **File:graph_demo_init.s
  6. **Date: 3rd Dec.95
  7. **©Lightsoft 1995.
  8. param1:    reg    r3        *Set up the names of the regs used for parameter passing
  9. param2:    reg    r4
  10. param3: reg    r5
  11. param4:    reg    r6
  12. bss:    reg    r30        *The register we use for global data
  13.     
  14. graph_demo_init:
  15.     mflr    r29    *save return address
  16.     bl    open_window
  17.     mtlr    r29
  18.     blr
  19.     
  20. open_window:
  21.     mflr    r28
  22.     li    `param1,128    *windows id is 128
  23.     li    `param2,0    *clear param2 - storage
  24.     li    `param3,-1    *behind
  25.     Xcall    GetNewCWindow    *Note NewCWindow, else we'd have problems with the colors.        
  26.     stw    `param1,window_1_ptr(`bss)
  27. **get the viewable rectangle (top,left,bottom,right)
  28.     la    r3,16(r3)    *windoptr+16=viewrect
  29.     la    r4,viewrect_1(`bss)
  30. **copy rectangle
  31.     lfs    f0,(r3)        *64 bit move into f0
  32.     stfs    f0,(r4)        *64 bit store into viewrect_1 (cool or what!)
  33.     lfs    f1,4(r3)    *change from previous lfd which will cause crashes on 604's
  34.     stfs    f1,4(r4)
  35.     
  36. **And copy to our second rectangle as well
  37.     la    r4,viewrect_2(`bss)
  38.     stfs    f0,(r4)        *into viewrect_2    
  39.     stfs    f0,4(r4)
  40. **set the port to our window
  41.     lwz    `param1,window_1_ptr(`bss)
  42.     Xcall    SetPort    
  43.     lwz    r10,white(rtoc)
  44.     mtlr    r28
  45.     blr
  46.  
  47. ****
  48.     global    graph_demo_init
  49.     extern_data    white
  50.